package com.flurry.sdk;

import android.support.v7.widget.ActivityChooserView;
import java.util.Comparator;

public class kj implements Comparator<Runnable> {
    private static final String a = kj.class.getSimpleName();

    public /* synthetic */ int compare(Object obj, Object obj2) {
        int a2 = a((Runnable) obj);
        int a3 = a((Runnable) obj2);
        if (a2 < a3) {
            return -1;
        }
        if (a2 > a3) {
            return 1;
        }
        return 0;
    }

    private static int a(Runnable runnable) {
        int i;
        if (runnable == null) {
            return ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
        }
        if (runnable instanceof kk) {
            mb mbVar = (mb) ((kk) runnable).a();
            if (mbVar != null) {
                i = mbVar.w;
            } else {
                i = Integer.MAX_VALUE;
            }
            return i;
        } else if (runnable instanceof mb) {
            return ((mb) runnable).w;
        } else {
            km.a(6, a, "Unknown runnable class: " + runnable.getClass().getName());
            return ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED;
        }
    }
}
